// mixins/pageScrollMixin.js
export default {
  data() {
    return {
      scrollTop: 0, // 当前滚动位置
	  topOpacity: 0,
    }
  },
  onPageScroll(e){
	  const max=80,min=20;
	  this.scrollTop=e.scrollTop;
	  this.topOpacity=e.scrollTop>=80 ? 1 : e.scrollTop<=20 ? 0 : Math.min(1, Math.max(0, (e.scrollTop - min) / (max - min)));
  }
}